// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : F:\MorPromosyon\Sorgu.xml
//  >Import : F:\MorPromosyon\Sorgu.xml>0
// Encoding : UTF-8
// Version  : 1.0
// (07.05.2013 22:26:44 - - $Rev: 45757 $)
// ************************************************************************ //

unit Sorgu1;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

const
  IS_OPTN = $0001;
  IS_UNBD = $0002;
  IS_NLBL = $0004;


type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Embarcadero types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"[Gbl]
  // !:int             - "http://www.w3.org/2001/XMLSchema"[Gbl]

  Input2               = class;                 { "http://takip.ptt.gov.tr"[Lit][GblCplx] }
  input                = class;                 { "http://takip.ptt.gov.tr"[Lit][GblElm] }
  OutputTum            = class;                 { "http://takip.ptt.gov.tr"[Lit][GblCplx] }
  gonderiSorguReturn   = class;                 { "http://takip.ptt.gov.tr"[Lit][GblElm] }
  OutputDongu          = class;                 { "http://takip.ptt.gov.tr"[GblCplx] }

  ArrayOfOutputDongu = array of OutputDongu;    { "http://takip.ptt.gov.tr"[GblCplx] }


  // ************************************************************************ //
  // XML       : Input, global, <complexType>
  // Namespace : http://takip.ptt.gov.tr
  // Serializtn: [xoLiteralParam]
  // Info      : Wrapper
  // ************************************************************************ //
  Input2 = class(TRemotable)
  private
    Fbarkod: string;
    Fkullanici: string;
    Fsifre: string;
  public
    constructor Create; override;
  published
    property barkod:    string  Index (IS_NLBL) read Fbarkod write Fbarkod;
    property kullanici: string  Index (IS_NLBL) read Fkullanici write Fkullanici;
    property sifre:     string  Index (IS_NLBL) read Fsifre write Fsifre;
  end;



  // ************************************************************************ //
  // XML       : input, global, <element>
  // Namespace : http://takip.ptt.gov.tr
  // Info      : Wrapper
  // ************************************************************************ //
  input = class(Input2)
  private
  published
  end;



  // ************************************************************************ //
  // XML       : OutputTum, global, <complexType>
  // Namespace : http://takip.ptt.gov.tr
  // Serializtn: [xoLiteralParam]
  // Info      : Wrapper
  // ************************************************************************ //
  OutputTum = class(TRemotable)
  private
    FALICI: string;
    FBARNO: string;
    FDEGKONUCR: string;
    FEKHIZ: string;
    FGONDEREN: string;
    FGONUCR: string;
    FGR: string;
    FIMERK: string;
    FITARIH: string;
    FODSARUCR: string;
    FTESALAN: string;
    FVMERK: string;
    Fdongu: ArrayOfOutputDongu;
    FsonucAciklama: string;
    FsonucKodu: Integer;
  public
    constructor Create; override;
    destructor Destroy; override;
  published
    property ALICI:         string              Index (IS_NLBL) read FALICI write FALICI;
    property BARNO:         string              Index (IS_NLBL) read FBARNO write FBARNO;
    property DEGKONUCR:     string              Index (IS_NLBL) read FDEGKONUCR write FDEGKONUCR;
    property EKHIZ:         string              Index (IS_NLBL) read FEKHIZ write FEKHIZ;
    property GONDEREN:      string              Index (IS_NLBL) read FGONDEREN write FGONDEREN;
    property GONUCR:        string              Index (IS_NLBL) read FGONUCR write FGONUCR;
    property GR:            string              Index (IS_NLBL) read FGR write FGR;
    property IMERK:         string              Index (IS_NLBL) read FIMERK write FIMERK;
    property ITARIH:        string              Index (IS_NLBL) read FITARIH write FITARIH;
    property ODSARUCR:      string              Index (IS_NLBL) read FODSARUCR write FODSARUCR;
    property TESALAN:       string              Index (IS_NLBL) read FTESALAN write FTESALAN;
    property VMERK:         string              Index (IS_NLBL) read FVMERK write FVMERK;
    property dongu:         ArrayOfOutputDongu  Index (IS_NLBL) read Fdongu write Fdongu;
    property sonucAciklama: string              Index (IS_NLBL) read FsonucAciklama write FsonucAciklama;
    property sonucKodu:     Integer             Index (IS_NLBL) read FsonucKodu write FsonucKodu;
  end;



  // ************************************************************************ //
  // XML       : gonderiSorguReturn, global, <element>
  // Namespace : http://takip.ptt.gov.tr
  // Info      : Wrapper
  // ************************************************************************ //
  gonderiSorguReturn = class(OutputTum)
  private
  published
  end;



  // ************************************************************************ //
  // XML       : OutputDongu, global, <complexType>
  // Namespace : http://takip.ptt.gov.tr
  // ************************************************************************ //
  OutputDongu = class(TRemotable)
  private
    FIMERK: string;
    FISLEM: string;
    FITARIH: string;
    FsiraNo: Integer;
  published
    property IMERK:  string   Index (IS_NLBL) read FIMERK write FIMERK;
    property ISLEM:  string   Index (IS_NLBL) read FISLEM write FISLEM;
    property ITARIH: string   Index (IS_NLBL) read FITARIH write FITARIH;
    property siraNo: Integer  Index (IS_NLBL) read FsiraNo write FsiraNo;
  end;


  // ************************************************************************ //
  // Namespace : http://takip.ptt.gov.tr
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : document
  // use       : literal
  // binding   : SorguSoapBinding
  // service   : SorguService
  // port      : Sorgu
  // URL       : http://pttws.ptt.gov.tr/GonderiTakip/services/Sorgu
  // ************************************************************************ //
  Sorgu = interface(IInvokable)
  ['{E108B773-43E0-F666-327E-9CAF5CCD95C5}']

    // Cannot unwrap: 
    //     - Input element wrapper name does not match operation's name
    //     - More than one strictly out element was found
    function  gonderiSorgu(const input: input): gonderiSorguReturn; stdcall;
  end;

function GetSorgu(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): Sorgu;


implementation
  uses SysUtils;

function GetSorgu(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): Sorgu;
const
  defWSDL = 'F:\Mor\MorPromosyon\Sorgu.xml';
  defURL  = 'https://pttws.ptt.gov.tr/GonderiTakip/services/Sorgu';
  defSvc  = 'SorguService';
  defPrt  = 'Sorgu';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as Sorgu);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;


constructor Input2.Create;
begin
  inherited Create;
  FSerializationOptions := [xoLiteralParam];
end;

constructor OutputTum.Create;
begin
  inherited Create;
  FSerializationOptions := [xoLiteralParam];
end;

destructor OutputTum.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(Fdongu)-1 do
    SysUtils.FreeAndNil(Fdongu[I]);
  System.SetLength(Fdongu, 0);
  inherited Destroy;
end;

initialization
  { Sorgu }
  InvRegistry.RegisterInterface(TypeInfo(Sorgu), 'http://takip.ptt.gov.tr', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(Sorgu), '');
  InvRegistry.RegisterInvokeOptions(TypeInfo(Sorgu), ioDocument);
  InvRegistry.RegisterInvokeOptions(TypeInfo(Sorgu), ioLiteral);
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfOutputDongu), 'http://takip.ptt.gov.tr', 'ArrayOfOutputDongu');
  RemClassRegistry.RegisterXSClass(Input2, 'http://takip.ptt.gov.tr', 'Input2', 'Input');
  RemClassRegistry.RegisterSerializeOptions(Input2, [xoLiteralParam]);
  RemClassRegistry.RegisterXSClass(input, 'http://takip.ptt.gov.tr', 'input');
  RemClassRegistry.RegisterXSClass(OutputTum, 'http://takip.ptt.gov.tr', 'OutputTum');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(OutputTum), 'dongu', '[ArrayItemName="item"]');
  RemClassRegistry.RegisterSerializeOptions(OutputTum, [xoLiteralParam]);
  RemClassRegistry.RegisterXSClass(gonderiSorguReturn, 'http://takip.ptt.gov.tr', 'gonderiSorguReturn');
  RemClassRegistry.RegisterXSClass(OutputDongu, 'http://takip.ptt.gov.tr', 'OutputDongu');

end.